package cae.mx
{

import flash.display.Graphics;
import mx.containers.Box;
import mx.containers.BoxDirection;
import mx.skins.ProgrammaticSkin;

/**
 *  The skin for the separator between the Links in a LinkBar.
 */
public class CaeLinkSeparator extends ProgrammaticSkin
{
	//include "../../core/Version.as";

	//--------------------------------------------------------------------------
	//
	//  Constructor
	//
	//--------------------------------------------------------------------------

	/**
	 *  Constructor.
	 */
	public function CaeLinkSeparator()
	{
		super();
	}
		
	//--------------------------------------------------------------------------
	//
	//  Overridden methods
	//
	//--------------------------------------------------------------------------

	/**
	 *  @private
	 */
	override protected function updateDisplayList(w:Number, h:Number):void
	{
		super.updateDisplayList(w, h);

		var separatorColor:uint = getStyle("separatorColor");
		var separatorWidth:Number = getStyle("separatorWidth");
		
		var isVertical:Boolean = false;
		
		var g:Graphics = graphics;
				
		g.clear();
		
		if (separatorWidth > 0)
		{
			if (parent is Box)
				isVertical = Box(parent).direction == BoxDirection.VERTICAL;
			
			g.lineStyle(1, separatorColor);
			
			if (isVertical)
			{
				g.moveTo(4, h / 2);
				g.lineTo(w - 4, h / 2);
			}
			else
			{
				g.beginFill(separatorColor);//
				
				g.moveTo(w / 2 + 2, h / 2);
				g.lineTo(2, h / 4);
				//g.lineTo(separatorWidth, -3);//
				g.lineTo(2, h * 3 / 4 );//
				
			}
		}
	}
}

}
